function checkLogin(type) {

	var token = uni.getStorageSync('token');
	console.log('未登录拦截执行', token == '');
	// getApp().globalData.userInfo = {name:"sss"}
	// console.log(getApp().globalData.userInfo)
	if (token == '') {
		uni.showModal({
			title: '提示',
			content: '您还未登录！是否前往登录？',
			success: function(res) {
				if (res.confirm) {
					uni.navigateTo({
						url: '/packageLogin/pages/login/login'
					});
					console.log('用户点击确定');
				} else if (res.cancel) {

					if (type == 'cancel') {
					
					} else {
						uni.switchTab({
							url: "/pages/home/home"
						})
					}


					console.log('用户点击取消');
				}
			}
		});

	}
	return token
}

module.exports.checkLogin = checkLogin